<admintpl file="header" />
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a >列表</a></li>
			<li><a href="{:U('Liang/add')}">添加</a></li>
		</ul>
		<form class="well form-search" method="post" action="{:U('Liang/index')}">
			状态： 
			<select class="select_2" name="status">
				<option value="-1">全部</option>
				<volist name="status" id="v">
					<option value="{$key}" <if condition="$formget.status eq $key">selected</if> >{$v}</option>
				</volist>

			</select> &nbsp;&nbsp;
			位数： 
			<select class="select_2" name="length">
				<option value="-1">全部</option>
				<volist name="length" id="v">
					<option value="{$v['length']}" <if condition="$formget.length eq $v['length']">selected</if> >{$v['length']}</option>
				</volist>
			</select> &nbsp;&nbsp;
			会员： 
			<input type="text" name="uid" style="width: 200px;" value="{$formget.uid}" placeholder="请输入会员ID值...">
			
			<input type="submit" class="btn btn-primary" value="搜索">
		</form>	
		<form method="post" class="js-ajax-form" action="{:U('Liang/listorders')}">
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit">{:L('SORT')}</button>
			</div>
		
			<table class="table table-hover table-bordered">
				<thead>
					<tr>
						<th>排序</th>
						<th align="center">ID</th>
						<th>靓号</th>
						<th>所需点数</th>
						<th>位数</th>
						<th>状态</th>
						<th>发布时间</th>
						<th>购买人</th>
						<th>购买时间</th>
						<th align="center">{:L('ACTIONS')}</th>
					</tr>
				</thead>
				<tbody>
					<foreach name="lists" item="vo">
					<tr>
					   <td><input name="listorders[{$vo['id']}]" type="text" size="3" value="{$vo['orderno']}" class="input input-order"></td>
						<td align="center">{$vo.id}</td>
						<td>{$vo['name']}</td>
						<td>{$vo['coin']}</td>
						<td>{$vo['length']}</td>
						<td>{$status[$vo['status']]}</td>
						<td>{$vo.addtime|date="Y-m-d H:i:s",###}</td>
						<if condition="$vo['uid'] eq '0'">
							<td>未出售</td>
							<td>未出售</td>
						<else/>
							<td>{$vo['userinfo']['user_nicename']} ({$vo['uid']})</td>
							<td>{$vo.buytime|date="Y-m-d H:i:s",###}</td>
						</if>

						<td align="center">	
							
							<if condition="$vo['status'] neq '1'">
							<a href="{:U('Liang/edit',array('id'=>$vo['id']))}" >编辑</a> 
							| 
							<a href="{:U('Liang/del',array('id'=>$vo['id']))}" class="js-ajax-dialog-btn" data-msg="您确定要删除吗？">删除</a>
							</if>
							<if condition="$vo['status'] eq '0'">
							 | <a href="{:U('Liang/setStatus',array('id'=>$vo['id'],'status'=>'2' ))}" class="js-ajax-dialog-btn" data-msg="您确定要停售吗？">停售</a>
							<elseif condition="$vo['status'] eq '2'"/>
							 | <a href="{:U('Liang/setStatus',array('id'=>$vo['id'],'status'=>'0'))}" class="js-ajax-dialog-btn" data-msg="您确定要出售吗？">出售</a>
							</if>
							

						</td>
					</tr>
					</foreach> 
				</tbody>
			</table>
			<div class="pagination">{$page}</div>
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit">{:L('SORT')}</button>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>